<head th:fragment="head(title)">
	<title th:text="${title}"></title>
	<!-- css样式 -->
	<link rel="canonical" href="/index.html">
	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon">
	<link rel="apple-touch-icon" href="/images/applogo.png">
	<link rel="stylesheet" href="/css/bootstrap.min.css" media="screen">
	<link rel="stylesheet" href="/css/index20161220.css">
	<link rel="stylesheet" href="/css/lostandfound_layoutframe_v0.1.1.css">

	<!-- js -->
	<script type="text/javascript" src="/js/jquery-1.10.2.min.js"></script>
	<script type="text/javascript" src="/easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="/easyui/locale/easyui-lang-zh_CN.js"></script>
	<script type="text/javascript" src="/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="/js/index20161220v1.0.js"></script>
	<script type="text/javascript" src="/js/loginhandler.js"></script>





<script type="text/javascript">

	// 全局变量
	var sessionStartTime = new Date().getTime(); // 毫秒数
	var sessionExpiresTime = 30 * 60 * 1000; // 30分钟（毫秒数）
	// 全局变量（当前用户）
	var USER = "${user}";

	// 已登录
	var isLogin = [[${session.user}==null]];
	// alert(isLogin);

	jQuery(document).ready(function() {
		// alert(window.location.href.substring(window.location.href.indexOf("${path}")));
		// 初始化url
		$("#srcUrl").val(window.location.href.substring(window.location.href.indexOf("${path}")));
		if(!isLogin) {
			$("#mobilelog").attr("style","display:block;");
		}
	});

	//判断是否存在指定函数
	function isExitsFunction(funcName) {
		try {
			if (typeof (eval(funcName)) == "function") {
				return true;
			}
		} catch (e) { }

		return false;
	}

	// 判断是否存在指定变量
	function isExitsVariable(variableName) {
		try {
			if (typeof (variableName) == "undefined") {
				return false;
			} else {
				return true;
			}
		} catch (e) { }

		return false;
	}

	//全局的ajax访问，处理ajax清求时sesion超时
	$.ajaxSetup({
		contentType:"application/x-www-form-urlencoded;charset=utf-8",
		complete:function(XMLHttpRequest,textStatus){
			// 刷新sessionTime
			sessionStartTime = new Date().getTime();
			//通过XMLHttpRequest取得响应头，sessionstatus，
			var sessionstatus = XMLHttpRequest.getResponseHeader("sessionstatus");
			if(sessionstatus == "timeout"){
				//如果超时就处理 ，指定要跳转的页面
				alert("页面过期，请重新登录!");
				parent.window.location.reload(true);
			}
		}
	});

</script>

<script>
	// 全局sessionTime监听变量
	var globalSessionTime;

	var ii = 0;
	// sessionTime监听函数
	function globalSessionValid() {
		var nowTime = new Date().getTime();

		console.log("nowTime---" +ii+ ": " +nowTime +" " +sessionStartTime+ " " +sessionExpiresTime);
		if((nowTime - sessionStartTime) > sessionExpiresTime) {
			USER = null;
			isLogin = false;
			clearInterval(globalSessionTime);
			//alert("globalSession...over");
			//关闭窗口
			if(isExitsFunction("close_window_mini"))
				close_window_mini();
		}

		ii ++;
	}

	// 判断监听器是否执行
	if(isLogin) {
		// 采用定时器来监听（每5秒监听一次）
		globalSessionTime = setInterval("globalSessionValid()", 5000);
	}

	// 判断屏幕
	function isSmallScreen() {
		return $("body").width() <= 960;
	}
</script>
</head>